﻿<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <title>method_1.html</title>
    <meta http-equiv="content-type" content="text/html; charset=UTF-8">
    <script type="text/javascript" src="../js/jquery-1.8.2.js"></script>
  </head>
  <body>
	
	
	<input type="button" value="原按钮" onclick="alert('静态事件')"/> 
		
	 	
	<script type="text/javascript">
	
		//复制原input元素，添加到原input元素后，与其同级
		var $old = $(":button");
		var $new = $old.clone();
		$new.val("新按钮");
		$old.after( $new );
		
		//为原input元素动态添加单击事件，且复制原input元素，
		//var $old = $(":button");
		//$old.click(function(){
		//	alert("动态事件");
		//});
		
        //添加到原input元素后，与其同级，且和原按钮有一样的行为
        //var $new = $old.clone(true);
        //$new.val("新按钮");
		//$old.after( $new );
		
	</script>
  </body>
</html>




